package cn.wen.forum.service;

import cn.wen.forum.common.result.JSONResult;
import cn.wen.forum.common.result.RequestParams;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.wen.forum.pojo.entity.Post;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @ClassName ForumService
 * @Author By wen
 * @Description
 * @Date 2023/3/7 11:15
 * @Version 1.0
 */
public interface IPostService extends IService<Post> {

    List<String> getSuggestion(String key);

    /**
     * 搜索帖子集合
     * @param requestParams
     * @return
     */
    JSONResult searchPostList(RequestParams requestParams);

    /**
     * 根据id获取帖子数据
     * @return
     */
    JSONResult getById(String id, HttpServletRequest request, HttpServletResponse response);

    /**
     * 发布帖子
     * @param post
     * @return
     */
    JSONResult toPublish(Post post) throws Exception;
}
